|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPER.rover.FindRockAction
An action to search for a rock intelligently. If the rover had to stop early because it detected an obstacle, the scan will cover a smaller range. If the first scan, which only looks short
Constructor Summary | |
FindRockAction(boolean obstacleDetected)
FindRockAction constructor |
Method Summary | |
int |
closestReading()
Gives you the minimum rock distance in cm. |
boolean |
doAction(Rover r)
Tries to start the action. |
long |
getImageUpdateTime()
Lets you know when the last image was taken by this action. |
int |
getMaxRockAngle()
Gives you the maximum angle at which the rock was found |
int |
getMinRockAngle()
Gives you the minimum angle at which the rock was found |
java.awt.image.BufferedImage |
getRecentImage()
Returns the most recent image taken by this Action. |
int |
getReturnValue()
The return value of the Action. |
int |
getRockAngle()
Getter for property rockAngle. |
int |
getRockDist()
Getter for property rockDist. |
java.lang.String |
getShortSummary()
Provides a shortened version of the summary returned by getSummary. |
java.lang.String |
getSummary()
Provides a textual explanation of the Action, such as "turn 90 degrees" |
int |
getTime()
How long the action will take, in milliseconds. |
int |
getTimeRemaining()
How much time until the action finishes (in milliseconds), if it has already started. |
boolean |
hasFoundRock()
Tells you whether the FindRockAction found a rock |
boolean |
isCompleted()
Whether the action has completed. |
boolean |
isSuccess()
Tells you whether the Action completed successfully. |
void |
kill()
this action can't currently be killed |
int |
moveFromRock(Rover rov,
int turnAngle)
If the rover is near a rock and will turn into it, this function should make it so that the rover won't hit the rock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FindRockAction(boolean obstacleDetected)
obstacleDetected
- should be set to true if the rover stopped early
because of a detected obstacle.Method Detail |
public boolean doAction(Rover r)
Action
doAction
in interface Action
public int getReturnValue()
Action
getReturnValue
in interface Action
RoverState
,
ActionConstants
public java.lang.String getShortSummary()
Action
getShortSummary
in interface Action
public java.lang.String getSummary()
Action
getSummary
in interface Action
public int getTime()
Action
getTime
in interface Action
public int getTimeRemaining()
Action
getTimeRemaining
in interface Action
public boolean isCompleted()
Action
isCompleted
in interface Action
public boolean isSuccess()
isSuccess
in interface Action
public void kill()
kill
in interface Action
public boolean hasFoundRock()
public int getRockAngle()
public int getRockDist()
public int getMinRockAngle()
public int getMaxRockAngle()
public int closestReading()
public int moveFromRock(Rover rov, int turnAngle)
rov
- An active instantion of a RoverturnAngle
- the angle that the rover is about to turnpublic long getImageUpdateTime()
Action
getImageUpdateTime
in interface Action
public java.awt.image.BufferedImage getRecentImage()
Action
getRecentImage
in interface Action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |